home *** CD-ROM | disk | FTP | other *** search
- #ifndef LIBRARIES_PATCH_H
- #define LIBRARIES_PATCH_H
- /*****************************************************************************/
- /*
- ** Filename: libraries/patch.h
- ** Release: 4.0
- ** Date: 31.01.96
- **
- ** definition of patch.library public structures and returncodes
- **
- ** (C) Copyright 1993-96 Stefan Fuchs
- ** All Rights Reserved
- */
- /*****************************************************************************/
-
- #ifndef EXEC_TYPES_H
- #include <exec/types.h>
- #endif
-
- #ifndef EXEC_LISTS_H
- #include <exec/lists.h>
- #endif /* EXEC_LISTS_H */
-
- #ifndef EXEC_LIBRARIES_H
- #include <exec/libraries.h>
- #endif /* EXEC_LIBRARIES_H */
-
- #ifndef EXEC_SEMAPHORES_H
- #include <exec/semaphores.h>
- #endif /* EXEC_SEMAPHORES_H */
-
-
- /*----------------------------------------------------------------------------*/
- /* Structure required to install new patches via patch.library/InstallPatch() */
-
- struct NewPatch /*this structure is OBSOLETE from V2 on */
- {
- APTR NPAT_NewCode; /* pointer to the patch code to be installed */
- ULONG NPAT_NewCodeSize; /* optional length of NPAT_NewCode in bytes */
- APTR NPAT_LibraryName; /* pointer to the LibraryName */
- UWORD NPAT_LibVersion; /* version of Library to open */
- WORD NPAT_LVO; /* LVO of function to patch */
- WORD NPAT_Priority; /* Priority (-127...+126) of the patch */
- UWORD NPAT_Flags; /* currently none defined (keep zero) */
- APTR NPAT_PatchName; /* optional pointer to an IDString */
- APTR NPAT_Result2; /* optional pointer to longword for Result2 */
- };
-
- /*----------------------------------------------------------------------------*/
-
- /* ErrorCodes */
- #define PATERR_Ok 0 /* Everything Ok */
- #define PATERR_PatchInUse 1 /* Patch Usecount <> 0 */
- #define PATERR_InvalidHandle 2 /* Pointer to patch is not (no longer) valid */
- #define PATERR_OutOfMem 3 /* Out of memory */
- #define PATERR_OpenLib 4 /* Failed to open requested library */
- #define PATERR_FuncNotStd 5 /* Function to patch is not in the standard format */
- #define PATERR_PatchInstalled 6 /* Can't remove patch because another program has */
- /* installed a non-patch.library patch later */
- #define PATERR_InvalidTags 7 /* There was an error in the combination of the specified Tags */
- #define PATERR_OpenDev 8 /* Failed to open requested device */
- #define PATERR_NoTaskList 9 /* PATT_AddTask... or PATT_RemTask... was specified for a patch, */
- /* which had no PATT_CreateTaskList set */
- #define PATERR_TaskListExists 10 /* PATT_CreateTaskList was specified, but there already exists a TaskList */
- #define PATERR_InvalidTaskList 11 /* PATT_CreateTaskList was specified with a wrong parameter */
- #define PATERR_PatchUnnamed 12 /* PATT_PatchName with GetPatch was specified, for a patch without an IDString */
- #define PATERR_NoSemaphore 13 /* Could not allocate semaphore */
-
-
- /*----------------------------------------------------------------------------*/
- #define PatchName "patch.library"
-
- /*----------------------------------------------------------------------------*/
-
-
-
-
- /*------------------------------------------------------------------------------*/
- /*------------------------------------------------------------------------------*/
- /* The following structures are not needed by normal patch.library applications */
- /*------------------------------------------------------------------------------*/
- /*------------------------------------------------------------------------------*/
- struct PatchBase
- {
- struct Library LibNode;
- UBYTE PB_Flags; /* no public flags defined */
- UBYTE PB_reserved1;
- ULONG PB_private1;
- struct SignalSemaphore PB_Semaphore; /* Semaphore to protect MasterPatchList */
- struct List PB_MasterPatchHeader; /* Listheader Structure for MasterPatch */
-
- /* ... */
-
- };
-
- /*----------------------------------------------------------------------------*/
- /* Before accessing this structure, make sure MPS_Node.ln_Type is PS_TYPE_MASTER */
-
- struct MasterPatch /* This structure is READONLY */
- {
- struct Node MPS_Node; /* ln_Name may contain a pointer to the name of the patched library */
- /* To compensate the loss of a valid librarybase */
- /* ln_Name is now (V4) guranteed to contain a valid name */
- /* This may however be a library, device or resource name */
- UWORD MPS_Flags; /* no public flags defined */
- struct MinList MPS_PatchHeader; /* Listheader Structure for Patch structures */
- APTR MPS_Private01; /* This pointer, up to V3 known as MPS_PatchedLibraryBase */
- /* has been renamed, because with the introduction of the */
- /* PatchSupervisor it may or may not contain a valid */
- /* librarybase, it may even contain 0. */
- UWORD MPS_PatchedLVO; /* Library Vektor Offset in patched library */
-
- /* ... */
-
- };
-
- /*----------------------------------------------------------------------------*/
- /* Before accessing this structure, make sure PS_Node.ln_Type is either PS_TYPE_USER or PS_TYPE_SYSTEM */
- /* Make sure your program can handle lists, that do not contain any nodes of */
- /* PS_TYPE_USER or PS_TYPE_SYSTEM */
-
- struct Patch /* This structure is READONLY */
- {
- struct Node PS_Node; /* ln_Name may contain a pointer to the name of the patch */
- UWORD PS_Flags; /* no public flags defined */
-
- /* ... */
-
- };
-
- /*----------------------------------------------------------------------------*/
- /* public types for patch and masterpatch structures: */
- #define PS_TYPE_MASTER 1 /* node is MasterPatch structure */
- #define PS_TYPE_USER 2 /* node was installed by an Application using the library interface */
- #define PS_TYPE_SYSTEM 3 /* node was installed by the support program PatchSetFunc */
-
-
-
- #endif /* LIBRARIES_PATCH_H */
-